package com.example.repository

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
import com.example.model.dataobject.UserProfileDO
import com.example.repository.mapper.UserProfileMapper
import org.springframework.stereotype.Repository
import org.springframework.transaction.annotation.Transactional

/**
 *
 *
 * @author wangli
 * @date 2025-10-10
 */
@Repository
class UserProfileRepository : ServiceImpl<UserProfileMapper, UserProfileDO>() {

    @Transactional
    fun insert(userProfileDO: UserProfileDO): Int {
        return baseMapper.insert(userProfileDO)
    }

    @Transactional
    fun insertThrowException(userProfileDO: UserProfileDO) {
        baseMapper.insert(userProfileDO)
        throw RuntimeException("User profile exception")
    }
}